package com.cgt.day5.toolClass;

import org.junit.Test;

import java.util.Arrays;

public class ToolClass {
    @Test
    public void test1(){
        //工具类
        int max1 = Math.max(3, 2);
        System.out.println(max1);
        double max2 = Math.max(3.0, 5.2);
        System.out.println(max2);
//      'Math()' has private access in 'java.lang.Math'
//      Math math = new Math();

//      Arrays数组操作的工具类
        int[] array = {34, 45, 7, 89};
        System.out.println(array);//[I@d7b1517
        System.out.println(Arrays.toString(array));
        Arrays.sort(array);
        System.out.println(Arrays.toString(array));
//      先Arrays.sort排好序，再进行二分查找
        int index = Arrays.binarySearch(array, 7);
        System.out.println(index);
    }
}
